
package com.xuexiang.xuidemo.app.adapter;

import android.os.Parcel;
import android.os.Parcelable;

public class WordListItem implements Parcelable {

    public String word;
    public String image;
    public String gifDisplay;
    public String video;

    public WordListItem(String word, String image, String gifDisplay, String video) {
        this.word = word;
        this.image = image;
        this.gifDisplay = gifDisplay;
        this.video = video;
    }

    private WordListItem(Parcel in) {
        word = in.readString();
        image = in.readString();
        gifDisplay = in.readString();
        video = in.readString();
    }

    @Override
    public String toString() {
        return "WordListItem{" +
                "word='" + word + '\'' +
                ", image='" + image + '\'' +
                ", gifDisplay='" + gifDisplay + '\'' +
                ", video='" + video + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(word);
        dest.writeString(image);
        dest.writeString(gifDisplay);
        dest.writeString(video);
    }

    public static final Parcelable.Creator<WordListItem> CREATOR = new Parcelable.Creator<WordListItem>() {
        @Override
        public WordListItem createFromParcel(Parcel source) {
            return new WordListItem(source);
        }

        @Override
        public WordListItem[] newArray(int size) {
            return new WordListItem[size];
        }
    };

}
